﻿using System;

namespace UniRx.Operators
{
	// Token: 0x020002B5 RID: 693
	internal class GroupedObservable<TKey, TElement> : IGroupedObservable<TKey, TElement>, IObservable<TElement>
	{
		// Token: 0x06000F12 RID: 3858 RVA: 0x00046348 File Offset: 0x00044748
		public GroupedObservable(TKey key, ISubject<TElement> subject, RefCountDisposable refCount)
		{
			this.key = key;
			this.subject = subject;
			this.refCount = refCount;
		}

		// Token: 0x17000109 RID: 265
		// (get) Token: 0x06000F13 RID: 3859 RVA: 0x00046365 File Offset: 0x00044765
		public TKey Key
		{
			get
			{
				return this.key;
			}
		}

		// Token: 0x06000F14 RID: 3860 RVA: 0x00046370 File Offset: 0x00044770
		public IDisposable Subscribe(IObserver<TElement> observer)
		{
			IDisposable disposable = this.refCount.GetDisposable();
			IDisposable disposable2 = this.subject.Subscribe(observer);
			return StableCompositeDisposable.Create(disposable, disposable2);
		}

		// Token: 0x040008C1 RID: 2241
		private readonly TKey key;

		// Token: 0x040008C2 RID: 2242
		private readonly IObservable<TElement> subject;

		// Token: 0x040008C3 RID: 2243
		private readonly RefCountDisposable refCount;
	}
}
